<template lang="">
  <div>
<input type="text" placeholder="请输入用户名" v-model="username">
<input type="password" placeholder="请输入密码" v-model="password">
<button @click="login">登录</button>
  </div>
</template>
<script setup>
import { ref } from 'vue';
import { adminLogin } from '../api/admin';
import router from '@/router';
var username = ref('');
var password = ref('');

function login() {
  adminLogin(username.value, password.value).then(res => {
    console.log(res)
    localStorage.setItem('token', res.data.token)
    router.push('/notice');
  })
}
</script>
<style lang="">

</style>
